package my.project.entity;

import my.spring.annotation.Column;
import my.spring.annotation.Entity;
import my.spring.annotation.Id;

/**
 * 用户实体
 */
@Entity("CREATE TABLE IF NOT EXISTS `users` (" +
        "  `id` int(11) unsigned NOT NULL AUTO_INCREMENT," +
        "  `username` varchar(64) DEFAULT NULL," +
        "  `password` varchar(64) DEFAULT NULL," +
        "  PRIMARY KEY (`id`)" +
        ") ENGINE=InnoDB DEFAULT CHARSET=utf8")
public class UserEntity {
    @Id
    @Column(value = "id", definition = "int(11) NOT NULL AUTO_INCREMENT")
    private Long id;

    @Column(value = "username", definition = "varchar(64) DEFAULT NULL")
    private String username;

    @Column(value = "password", definition = "varchar(64) DEFAULT NULL")
    private String password;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
